﻿<%
'*********************************************************
' 目的：
'*********************************************************
Function Couple_RndSexualityTags(ByRef html)
	html=Replace(html,"<#article/author/sex#>",GetRndSexuality())
End Function
Function Couple_RndSexualityGuestbook(ByRef html,ByRef htmlWAP)
	html=Replace(html,"<#article/author/sex#>",GetRndSexuality())
End Function
'*********************************************************


'*********************************************************
' 目的：
'*********************************************************
Function GetRndSexuality()
	Randomize
	Dim intSex
	intSex=CInt(Rnd)
	'intSex=CInt(Rnd * 1987) Mod 2
	If intSex=0 Then GetRndSexuality="Male"
	If intSex=1 Then GetRndSexuality="Female"
End Function
'*********************************************************




'*********************************************************
' 目的：
'*********************************************************
Function Couple_SetSexuality(ByRef aryTemplateTagsName,ByRef aryTemplateTagsValue)

	Dim c:c=UBOUND(aryTemplateTagsName)+1
	ReDim Preserve aryTemplateTagsName(c)
	ReDim Preserve aryTemplateTagsValue(c)

	Dim Sexuality
	Select Case aryTemplateTagsValue(18)
		Case Couple_MaleID
			Sexuality="Male"
		Case Couple_FemaleID
			Sexuality="Female"
	End Select
	aryTemplateTagsName(c)="article/author/sex"
	aryTemplateTagsValue(c)=Sexuality

End Function
'*********************************************************




'*********************************************************
' 目的：
'*********************************************************
Function Couple_CacheCatalogPriority(ByVal intCateId,ByVal intAuthorId,ByVal dtmYearMonth,ByVal strTagsName)

	Dim objRS,sql
	If Not IsEmpty(intCateId) Then
		sql=sql & "AND([log_CateID]="&intCateId&")"
	End if
	If Not IsEmpty(intAuthorId) Then
		sql=sql & "AND([log_AuthorID]="&intAuthorId&")"
	End if
	If IsDate(dtmYearMonth) Then
		Dim y
		Dim m
		Dim d

		If IsDate(dtmYearMonth) Then
		'	dtmYearMonth=CDate(dtmYearMonth)
		Else
			Call showError(3)
		End If

		y=Year(dtmYearMonth)
		m=Month(dtmYearMonth)
		d=Day(dtmYearMonth)

		If InstrRev(CStr(dtmYearMonth),"-")>=7 Then
			sql=sql & "AND(Year([log_PostTime])="&y&") AND(Month([log_PostTime])="&m&") AND(Day([log_PostTime])="&d&")"
		Else
			sql=sql & "AND(Year([log_PostTime])="&y&") AND(Month([log_PostTime])="&m&")"
		End If

	End If
	If Not IsEmpty(strTagsName) Then
		Dim Tag
		For Each Tag in Tags
			If IsObject(Tag) Then
				If UCase(Tag.Name)=UCase(strTagsName) Then
					sql=sql & "AND([log_Tag] LIKE '%{" & Tag.ID & "}%')"
				End If
			End If
		Next
	End If

	Dim CatalogPriority

	Dim maleCount
	Set objRS=objConn.Execute("SELECT COUNT([log_ID]) FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Level]>1) AND ([log_Istop]=False) And ([log_AuthorID]="&Couple_MaleID&") " & sql)
		maleCount=objRS(0)
	Set objRS=Nothing

	Dim femaleCount
	Set objRS=objConn.Execute("SELECT COUNT([log_ID]) FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Level]>1) AND ([log_Istop]=False) And ([log_AuthorID]="&Couple_FemaleID&") " & sql)
		femaleCount=objRS(0)
	Set objRS=Nothing

	CatalogPriority=Couple_MaleID &","& maleCount &","& Couple_FemaleID &","& femaleCount

	If IsEmpty(intCateId) And IsEmpty(intAuthorId) And Not IsDate(dtmYearMonth) And IsEmpty(strTagsName) Then
		Call SaveToFile(BlogPath & "THEMES/"& ZC_BLOG_THEME &"/INCLUDE/index.html",CatalogPriority,"utf-8",False)
	End If

	Couple_CacheCatalogPriority=CatalogPriority

End Function
'*********************************************************




'*********************************************************
' 目的：
'*********************************************************
Function Couple_TemplateSubCate(ByRef aryTemplateSubName,ByRef aryTemplateSubValue)

	Dim intPage,intCateId,dtmYearMonth,intTagId,strTagsName
	intPage=aryTemplateSubValue(12)
	intCateId=aryTemplateSubValue(7)
	intTagId=aryTemplateSubValue(6)
	dtmYearMonth=aryTemplateSubValue(11)
	If Not IsEmpty(intTagId) Then
		If IsObject(Tags(intTagId)) Then
			strTagsName=Tags(intTagId).Name
		End If
	End If

	Dim c:c=UBOUND(aryTemplateSubName)+1
	ReDim Preserve aryTemplateSubName(c)
	ReDim Preserve aryTemplateSubValue(c)
	aryTemplateSubName(c)="template:article-multi-male"
	aryTemplateSubValue(c)=Couple_BuildTemplateSub(intPage,intCateId,Couple_MaleID,dtmYearMonth,strTagsName)

	c=c+1
	ReDim Preserve aryTemplateSubName(c)
	ReDim Preserve aryTemplateSubValue(c)
	aryTemplateSubName(c)="template:article-multi-female"
	aryTemplateSubValue(c)=Couple_BuildTemplateSub(intPage,intCateId,Couple_FemaleID,dtmYearMonth,strTagsName)

End Function
'*********************************************************


'*********************************************************
' 目的：
'*********************************************************
Function Couple_BuildTemplateSub(ByVal intPage,ByVal intCateId,ByVal intAuthorId,ByVal dtmYearMonth,ByVal strTagsName)

	If intAuthorId=Couple_FemaleID Then
		If (intPage*ZC_DISPLAY_COUNT-Couple_FemalePriority_Count) >= ZC_DISPLAY_COUNT Then
			Couple_BuildTemplateSub=Empty
			Exit Function
		End If
	End If

	If intAuthorId=Couple_MaleID Then
		If (intPage*ZC_DISPLAY_COUNT-Couple_MalePriority_Count) >= ZC_DISPLAY_COUNT Then
			Couple_BuildTemplateSub=Empty
			Exit Function
		End If
	End If

	Dim strType
	Dim AllList
	Dim aryArticle
	Dim i,j,k,l,s
	Dim objRS
	Dim intPageCount
	Dim objArticle
	Dim intAllPage

	Dim aryArticleList()

	Call CheckParameter(intAuthorId,"int",Empty)

	Set objRS=Server.CreateObject("ADODB.Recordset")
	objRS.CursorType = adOpenKeyset
	objRS.LockType = adLockReadOnly
	objRS.ActiveConnection=objConn

	objRS.Source="SELECT [log_ID] FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Istop]=False) AND ([log_Level]>1)"

	If Not IsEmpty(intCateId) Then
		objRS.Source=objRS.Source & "AND([log_CateID]="&intCateId&")"
	End if
	If Not IsEmpty(intAuthorId) Then
		objRS.Source=objRS.Source & "AND([log_AuthorID]="&intAuthorId&")"
	End If

	If IsDate(dtmYearMonth) Then
		Dim y
		Dim m
		Dim d

		If IsDate(dtmYearMonth) Then
		'	dtmYearMonth=CDate(dtmYearMonth)
		Else
			Call showError(3)
		End If

		y=Year(dtmYearMonth)
		m=Month(dtmYearMonth)
		d=Day(dtmYearMonth)

		If InstrRev(CStr(dtmYearMonth),"-")>=7 Then
			objRS.Source=objRS.Source & "AND(Year([log_PostTime])="&y&") AND(Month([log_PostTime])="&m&") AND(Day([log_PostTime])="&d&")"
		Else
			objRS.Source=objRS.Source & "AND(Year([log_PostTime])="&y&") AND(Month([log_PostTime])="&m&")"
		End If

	End If
	If Not IsEmpty(strTagsName) Then
		Dim Tag
		For Each Tag in Tags
			If IsObject(Tag) Then
				If UCase(Tag.Name)=UCase(strTagsName) Then
					objRS.Source=objRS.Source & "AND([log_Tag] LIKE '%{" & Tag.ID & "}%')"
				End If
			End If
		Next
	End If

	objRS.Source=objRS.Source & "ORDER BY [log_PostTime] DESC,[log_ID] DESC"
	objRS.Open()

	If (Not objRS.bof) And (Not objRS.eof) Then
		objRS.PageSize = ZC_DISPLAY_COUNT
		intPageCount=objRS.PageCount
		objRS.AbsolutePage = intPage

		For i = 1 To objRS.PageSize

			ReDim Preserve aryArticleList(i)

			Set objArticle = New TArticle
			objArticle.ID=objRS(0)
			If objArticle.LoadCache Then
				aryArticleList(i)=objArticle.Template_Article_Multi
			End if
			Set objArticle = Nothing

			objRS.MoveNext
			If objRS.EOF Then Exit For

		Next

	End If

	objRS.Close()
	Set objRS=Nothing

	Couple_BuildTemplateSub=k & Join(aryArticleList)


End Function
'*********************************************************




'*********************************************************
' 目的：
'*********************************************************
Function Couple_TemplateSubIndex(ByRef aryTemplateSubName,ByRef aryTemplateSubValue)

	Dim c:c=UBOUND(aryTemplateSubName)+1
	ReDim Preserve aryTemplateSubName(c)
	ReDim Preserve aryTemplateSubValue(c)
	aryTemplateSubName(c)="template:article-multi-male"
	aryTemplateSubValue(c)=Couple_BuildTemplateIndex("Male")

	c=c+1
	ReDim Preserve aryTemplateSubName(c)
	ReDim Preserve aryTemplateSubValue(c)
	aryTemplateSubName(c)="template:article-multi-female"
	aryTemplateSubValue(c)=Couple_BuildTemplateIndex("Female")

End Function
'*********************************************************


'*********************************************************
' 目的：
'*********************************************************
Function Couple_BuildTemplateIndex(ByVal strSexuality)

	Dim strCacheList,arySexuality
	strCacheList=LoadFromFile(BlogPath & "/CACHE/cache_list_couple_"&ZC_BLOG_CLSID&".html","utf-8")
	arySexuality=Split(strCacheList,"|")

	Dim aryArticle,objArticle,strArticle,i
	Select Case strSexuality

		Case "Male"

			aryArticle=Split(arySexuality(0),";")

			If IsArray(aryArticle) Then

				For i=LBound(aryArticle) To UBound(aryArticle)-1
					Set objArticle = New TArticle
					objArticle.ID=aryArticle(i)
					If objArticle.LoadCache Then
						strArticle=strArticle & objArticle.Template_Article_Multi
					End if
					Set objArticle = Nothing
				Next

			End If

		Case "Female"

			aryArticle=Split(arySexuality(1),";")

			If IsArray(aryArticle) Then

				For i=LBound(aryArticle) To UBound(aryArticle)-1
					Set objArticle = New TArticle
					objArticle.ID=aryArticle(i)
					If objArticle.LoadCache Then
						strArticle=strArticle & objArticle.Template_Article_Multi
					End if
					Set objArticle = Nothing
				Next

			End If

	End Select

	Couple_BuildTemplateIndex=strArticle
End Function
'*********************************************************




'*********************************************************
' 目的：
'*********************************************************
Function Couple_BuildIstop()

	Dim i
	Dim objRS
	Dim objStream
	Dim objArticle

	'Istop
	Dim strIstop

	Set objRS=objConn.Execute("SELECT [log_ID] FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Level]>1) AND ([log_Istop]=True) ORDER BY [log_PostTime] DESC")
	If (Not objRS.bof) And (Not objRS.eof) Then
		For i=1 to Couple_ListCount
			Set objArticle=New TArticle
			If objArticle.LoadInfoByID(objRS("log_ID")) Then
				If objArticle.AuthorID = Couple_MaleID Then
					strIstop=strIstop & "<li class=""istop-male""><h2><a href="""& objArticle.Url & """ title="""& objArticle.HtmlTitle &" "& aryCouple_LanguageValue(39) &"("& objArticle.CommNums &") "& aryCouple_LanguageValue(38) &"("& objArticle.ViewNums &")""><span class=""article-date"">["& Right("0" & Month(objArticle.PostTime),2) & "/" & Right("0" & Day(objArticle.PostTime),2) &"]</span>" & objArticle.Title & "</a></h2></li>" & VbCrlf
				ElseIf objArticle.AuthorID = Couple_FemaleID Then
					strIstop=strIstop & "<li class=""istop-female""><h2><a href="""& objArticle.Url & """ title="""& objArticle.HtmlTitle &" "& aryCouple_LanguageValue(39) &"("& objArticle.CommNums &") "& aryCouple_LanguageValue(38) &"("& objArticle.ViewNums &")""><span class=""article-date"">["& Right("0" & Month(objArticle.PostTime),2) & "/" & Right("0" & Day(objArticle.PostTime),2) &"]</span>" & objArticle.Title & "</a></h2></li>" & VbCrlf
				End If
			End If
			Set objArticle=Nothing
			objRS.MoveNext
			If objRS.eof Then Exit For
		Next
	End If
	objRS.close
	Set objRS=Nothing

	If Not IsEmpty(strIstop) Then

		strIstop="<ul>" & strIstop
		strIstop="<h3>"&aryCouple_LanguageValue(10)&"</h3>" & strIstop
		strIstop="<div class=""function"" id=""divIstop"">" & strIstop

		strIstop=strIstop & "</ul>"
		strIstop=strIstop & "</div>"

	End If

	strIstop=TransferHTML(strIstop,"[no-asp]")

	Call SaveToFile(BlogPath & "THEMES/"& ZC_BLOG_THEME &"/INCLUDE/Istop.asp",strIstop,"utf-8",False)

End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_BuildNavBar()

	Dim strContent
	Dim objRegExp
	Set objRegExp=new RegExp
	objRegExp.IgnoreCase =True
	objRegExp.Global=True

	Dim Match, Matches
	Dim s1,s2,s3,s
	Dim i,j

	strContent=""
	strContent=LoadFromFile(BlogPath & "INCLUDE/navbar.asp","utf-8")

	objRegExp.Pattern="((<a .*>)(.+?)(\/a>))"

	Set Matches = objRegExp.Execute(strContent)
	For Each Match in Matches

		s=Match

		objRegExp.Pattern="(<a .*"">)(.+?)(</a>)"
		s=objRegExp.Replace(s,"$1"&"<span>"&"$2"&"</span>"&"$3")

		strContent=Replace(strContent,Match,s)
	Next

	Call SaveToFile(BlogPath & "THEMES/"& ZC_BLOG_THEME &"/INCLUDE/navbar.asp",strContent,"utf-8",False)

End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_BuildPrevious(ByVal strGender,ByVal intAuthorID)

	Dim i
	Dim objRS
	Dim objStream
	Dim objArticle

	'Previous
	Dim strPrevious
	Set objRS=objConn.Execute("SELECT [log_ID] FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Level]>1) AND ([log_AuthorID]="&intAuthorID&") ORDER BY [log_PostTime] DESC")

	If (Not objRS.bof) And (Not objRS.eof) Then
		For i=1 to Couple_ListCount
			Set objArticle=New TArticle
			If objArticle.LoadInfoByID(objRS("log_ID")) Then
				strPrevious=strPrevious & "<li><a href="""& objArticle.Url & """ title="""& objArticle.HtmlTitle &" "& aryCouple_LanguageValue(39) &"("& objArticle.CommNums &") "& aryCouple_LanguageValue(38) &"("& objArticle.ViewNums &")""><span class=""article-date"">["& Right("0" & Month(objArticle.PostTime),2) & "/" & Right("0" & Day(objArticle.PostTime),2) &"]</span>" & objArticle.Title & "</a></li>" & VbCrlf
			End If
			Set objArticle=Nothing
			objRS.MoveNext
			If objRS.eof Then Exit For
		Next
	End If
	objRS.close
	Set objRS=Nothing
	strPrevious=TransferHTML(strPrevious,"[no-asp]")

	Call SaveToFile(BlogPath & "THEMES/"& ZC_BLOG_THEME &"/INCLUDE/Previous_"&strGender&".asp",strPrevious,"utf-8",False)

End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_BuildHotPost(ByVal strGender,ByVal intAuthorID)

	Dim i
	Dim objRS
	Dim objStream
	Dim objArticle

	Dim sql
	Select Case Couple_HotPostOrder
		Case "A"
		sql=" ORDER BY [log_CommNums] DESC,[log_ViewNums] DESC"
		Case "B"
		sql=" ORDER BY [log_CommNums]*100 + [log_TrackBackNums]*200 + sqr([log_ViewNums])*10 DESC"
		Case "C"
		sql=" ORDER BY [log_CommNums]*100 + [log_TrackBackNums]*200 + sqr([log_ViewNums])*10 - (date()-[Log_PostTime])*(date()-[Log_PostTime]) DESC"
		Case Else
		sql=" ORDER BY [log_CommNums] DESC,[log_ViewNums] DESC"
	End Select

	'Previous
	Dim strHotPost

	Set objRS=objConn.Execute("SELECT [log_ID] FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Level]>1) AND ([log_PostTime]>Now()-"& Couple_HotPostDays &") AND ([log_AuthorID]="&intAuthorID&")" & sql)

	If (Not objRS.bof) And (Not objRS.eof) Then
		For i=1 to Couple_ListCount
			Set objArticle=New TArticle
			If objArticle.LoadInfoByID(objRS("log_ID")) Then
				strHotPost=strHotPost & "<li><a href="""& objArticle.Url & """ title="""& objArticle.HtmlTitle &" "& aryCouple_LanguageValue(39) &"("& objArticle.CommNums &") "& aryCouple_LanguageValue(38) &"("& objArticle.ViewNums &")""><span class=""article-date"">["& Right("0" & Month(objArticle.PostTime),2) & "/" & Right("0" & Day(objArticle.PostTime),2) &"]</span>" & objArticle.Title & "</a></li>" & VbCrlf
			End If
			Set objArticle=Nothing
			objRS.MoveNext
			If objRS.eof Then Exit For
		Next
	End If
	objRS.close
	Set objRS=Nothing

	strHotPost=TransferHTML(strHotPost,"[no-asp]")

	Call SaveToFile(BlogPath & "THEMES/"& ZC_BLOG_THEME &"/INCLUDE/HotPosts_"&strGender&".asp",strHotPost,"utf-8",False)

End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_BuildRandom(ByVal strGender,ByVal intAuthorID)

	Dim i,j
	Dim m,n
	Dim objRS
	Dim objStream
	Dim objArticle

	Dim strRandom
	Dim strID,aryID,tmpID,dynID()

	Set objRS=objConn.Execute("SELECT [log_ID] FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Level]>1) AND ([log_PostTime]>Now()-"& Couple_RandomDays &") AND ([log_AuthorID]="&intAuthorID&")")
	If (Not objRS.bof) And (Not objRS.eof) Then
		Do While Not objRS.eof
			strID = strID &" "& objRS("log_ID")
			objRS.MoveNext
		Loop
	End If
	objRS.close
	Set objRS=Nothing

	If Not InStr(strID," ")>0 Then
		Call SaveToFile(BlogPath & "THEMES/"& ZC_BLOG_THEME &"/INCLUDE/RndPosts_"&strGender&".asp"," ","utf-8",False)
		Exit Function
	End If

	strID=Trim(strID)
	aryID=Split(strID," ")

	For i=1 To Couple_ListCount

		Randomize
		m=Int((UBound(aryID,1)+1) * Rnd)
		tmpID=aryID(m)

		j=0
		For Each n In aryID
			If Not n=tmpID Then
				ReDim Preserve dynID(j)
				dynID(j)=n
				j=j+1
			End If
		Next

		Set objArticle = New TArticle

			If objArticle.LoadInfoByID(tmpID) Then
				strRandom=strRandom & "<li><a href="""& objArticle.Url & """ title="""& objArticle.HtmlTitle &" "& aryCouple_LanguageValue(39) &"("& objArticle.CommNums &") "& aryCouple_LanguageValue(38) &"("& objArticle.ViewNums &")""><span class=""article-date"">["& Right("0" & Month(objArticle.PostTime),2) & "/" & Right("0" & Day(objArticle.PostTime),2) &"]</span>" & objArticle.Title & "</a></li>" & VbCrlf
			End If

		Set objArticle=Nothing

		If UBound(aryID,1)=0 Then Exit For

		aryID=dynID

	Next

	strRandom=TransferHTML(strRandom,"[no-asp]")

	Call SaveToFile(BlogPath & "THEMES/"& ZC_BLOG_THEME &"/INCLUDE/RndPosts_"&strGender&".asp",strRandom,"utf-8",False)

End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_BlogReBuild_GuestComments()

	Dim objRS
	Dim objStream
	Dim objArticle

	'Comments
	Dim strComments

	Dim s
	Dim i
	Set objRS=objConn.Execute("SELECT [log_ID],[comm_ID],[comm_Content],[comm_HomePage],[comm_PostTime],[comm_Author] FROM [blog_Comment] WHERE [log_ID]=0 ORDER BY [comm_ID] DESC")
	If (Not objRS.bof) And (Not objRS.eof) Then
		For i=1 to ZC_MSG_COUNT
			s=TransferHTML(UBBCode(objRS("comm_Content"),"[link][link-antispam][font][face]"),"[nohtml]")
			If (len(s)>ZC_RECENT_COMMENT_WORD_MAX) And (ZC_RECENT_COMMENT_WORD_MAX>(Len(ZC_MSG305)+1)) Then s=Left(s,ZC_RECENT_COMMENT_WORD_MAX-(Len(ZC_MSG305)+1))&ZC_MSG305

			If InStr(objRS("comm_HomePage"),"://")>0 Then
				strComments=strComments & "<li><a href="""& URLEncodeForAntiSpam(objRS("comm_HomePage")) &""" title="""& objRS("comm_HomePage") &""" target=""_blank""><strong>" & objRS("comm_Author") & "</strong></a>: <a href="""& ZC_BLOG_HOST & "guestbook.asp" & "#cmt" & objRS("comm_ID") & """ title=""" & objRS("comm_PostTime") & """>"+s+"</a></li>"
			Else
				strComments=strComments & "<li><strong>" & objRS("comm_Author") & "</strong>: <a href="""& ZC_BLOG_HOST & "guestbook.asp" & "#cmt" & objRS("comm_ID") & """ title=""" & objRS("comm_PostTime") & """>"+s+"</a></li>"
			End If

			objRS.MoveNext
			If objRS.eof Then Exit For
		Next
	End If
	objRS.close
	Set objRS=Nothing

	strComments=TransferHTML(strComments,"[no-asp]")

	Call SaveToFile(BlogPath & "/include/guestcomments.asp",strComments,"utf-8",True)

	Couple_BlogReBuild_GuestComments=True

End Function
'*********************************************************


'*********************************************************
' 目的：
'*********************************************************
Function Couple_BlogReBuild_Comments()

	Dim objRS
	Dim objStream
	Dim objArticle

	'Comments
	Dim strComments

	Dim s
	Dim i
	Set objRS=objConn.Execute("SELECT [log_ID],[comm_ID],[comm_Content],[comm_HomePage],[comm_PostTime],[comm_Author] FROM [blog_Comment] WHERE [log_ID]>0 ORDER BY [comm_PostTime] DESC,[comm_ID] DESC")
	If (Not objRS.bof) And (Not objRS.eof) Then
		For i=1 to ZC_MSG_COUNT
			s=TransferHTML(UBBCode(objRS("comm_Content"),"[link][link-antispam][font][face]"),"[nohtml]")
			If (Len(s)>ZC_RECENT_COMMENT_WORD_MAX) And (ZC_RECENT_COMMENT_WORD_MAX>(Len(ZC_MSG305)+1)) Then s=Left(s,ZC_RECENT_COMMENT_WORD_MAX-(Len(ZC_MSG305)+1))&ZC_MSG305

			Set objArticle=New TArticle
			If objArticle.LoadInfoByID(objRS("log_ID")) Then
				If InStr(objRS("comm_HomePage"),"://")>0 Then
					strComments=strComments & "<li><a href="""& URLEncodeForAntiSpam(objRS("comm_HomePage")) &""" title="""& objRS("comm_HomePage") &""" target=""_blank""><strong>" & objRS("comm_Author") & "</strong></a>: <a href="""& objArticle.Url & "#cmt" & objRS("comm_ID") & """ title=""" & objRS("comm_PostTime") & """>"+s+"</a></li>"
				Else
					strComments=strComments & "<li><strong>" & objRS("comm_Author") & "</strong>: <a href="""& objArticle.Url & "#cmt" & objRS("comm_ID") & """ title=""" & objRS("comm_PostTime") & """>"+s+"</a></li>"
				End If
			End If
			Set objArticle=Nothing
			objRS.MoveNext
			If objRS.eof Then Exit For
		Next
	End If
	objRS.close
	Set objRS=Nothing

	strComments=TransferHTML(strComments,"[no-asp]")

	Call SaveToFile(BlogPath & "/include/comments.asp",strComments,"utf-8",True)

	Couple_BlogReBuild_Comments=True

End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_BlogReBuild_Tags()

	Dim objRS
	Dim objStream

	'Tags
	Dim i,j
	i=Couple_TagsCount
	j=0

	Dim strColor
	Dim n,m
	Dim c,r,s,t
	c=0
	r=0
	s=0
	t=0

	Dim Sql
	Select Case Couple_TagsOrder
		Case "Name"
		Sql = " ORDER BY [tag_Name] ASC"
		Case "ID"
		Sql = " ORDER BY [tag_ID] ASC"
		Case "Count"
		Sql = " ORDER BY [tag_Count] DESC"
		Case Else
		Sql = " ORDER BY [tag_Count] DESC"
	End Select
	Sql = " WHERE [tag_Count]>=" & Couple_TagsFilter & Sql

	Dim strTag,x

	Set objRS=objConn.Execute("SELECT TOP "&i&" * FROM [blog_Tag]" & Sql)
	If (Not objRS.bof) And (Not objRS.eof) Then

		Do While Not objRS.eof
			c=Tags(objRS("tag_ID")).Count
			If t =< c Then t=c
			s=s+c
			r=r+1
			objRS.MoveNext
		Loop
		objRS.MoveFirst

		n=(238/((t+(s/r))/2))

		Do While Not objRS.eof
			If j=i Then Exit Do

			If Tags(objRS("tag_ID")).Count<=50 Then
				x=Tags(objRS("tag_ID")).Count*2
			ElseIf Tags(objRS("tag_ID")).Count>50 And Tags(objRS("tag_ID")).Count<=100 Then
				x=Tags(objRS("tag_ID")).Count*1.5
			ElseIf Tags(objRS("tag_ID")).Count>100 And Tags(objRS("tag_ID")).Count<=200 Then
				x=Tags(objRS("tag_ID")).Count*1.2
			ElseIf Tags(objRS("tag_ID")).Count>200 Then
				x=Tags(objRS("tag_ID")).Count*1
			End If

			m=Int(n*Tags(objRS("tag_ID")).Count)
			If m>255 Then m=255
			m=Right("0" & Cstr(Hex(m)),2)
			strColor = m & "99" & "00"

			strTag=strTag & "<span style=""font-family:verdana,sans-serif;line-height:150%;font-size:"& (100 + (x)) &"%;""><a title=""" & Tags(objRS("tag_ID")).Count & """ href=""" & Tags(objRS("tag_ID")).Url &""" style=""color:#"&strColor&";"">" & Tags(objRS("tag_ID")).name & "</a></span> "

			objRS.MoveNext
			j=j+1
		Loop
	End If
	objRS.Close
	Set objRS=Nothing

	strTag=TransferHTML(strTag,"[no-asp]")

	Call SaveToFile(BlogPath & "/include/tags.asp",strTag,"utf-8",True)

	Couple_BlogReBuild_Tags=True

End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_BlogReBuild_Catalogs()

	Dim objRS
	Dim objStream

	Dim ArtList

	'Catalogs
	Dim strCatalog
	Set objRS=objConn.Execute("SELECT * FROM [blog_Category] ORDER BY [cate_Order] ASC,[cate_Count] DESC,[cate_ID] ASC")
	If (Not objRS.bof) And (Not objRS.eof) Then
		Do While Not objRS.eof

			strCatalog=strCatalog & "<li><a href="""& Categorys(objRS("cate_ID")).Url & """>"+Categorys(objRS("cate_ID")).Name + " (" & Categorys(objRS("cate_ID")).Count & ")" +"</a></li>"

			If ZC_MOONSOFT_PLUGIN_ENABLE=True Then
				Call BuildCategory(Empty,Categorys(objRS("cate_ID")).ID,Empty,Empty,Empty,ZC_DISPLAY_MODE_ALL,Categorys(objRS("cate_ID")).Directory,Categorys(objRS("cate_ID")).FileName)
			End If

			objRS.MoveNext

		Loop
	End If
	objRS.Close
	Set objRS=Nothing

	strCatalog=TransferHTML(strCatalog,"[no-asp]")

	Call SaveToFile(BlogPath & "/include/catalog.asp",strCatalog,"utf-8",True)

	Couple_BlogReBuild_Catalogs=True

End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_BlogReBuild_Archives()
	Dim firstTime,lastTime
	Dim sql,objRS,objStream
	sql = "SELECT [log_PostTime] FROM [blog_Article] WHERE ([log_Level]>1) ORDER BY [log_PostTime]"
	Set objRS = Server.CreateObject("adodb.recordset")
	objRS.open sql,objConn,1,1
	If (Not objRS.bof) And (Not objRS.eof) Then
		firstTime = objRS("log_PostTime")
		objRS.movelast
		lastTime = objRS("log_PostTime")
	End if
	objRS.Close
	Set objRS=Nothing

	Dim i,j,strArchives,strArchiveYear
	Dim k,l
	For i = Year(lastTime) To Year(firstTime) step -1
		k=0
		l=False
		strArchiveYear=""
		For j = 1 To 12
			If i>= Year(Now()) And j > Month(Now()) Then Exit For
			If i = Year(firstTime) And  j < Month(firstTime) Then j = Month(firstTime)

			Set objRS=objConn.Execute("SELECT COUNT([log_ID]) FROM [blog_Article] WHERE ([log_Level]>1) AND year(log_PostTime) = " & i & " and month(log_PostTime) = " & j)

			If (Not objRS.bof) And (Not objRS.eof) Then
				If objRS(0) > 0 then
					k=k+1
					l=True
					If ZC_MOONSOFT_PLUGIN_ENABLE=True Then
						Call BuildCategory(Empty,Empty,Empty,i & "-" & j,Empty,ZC_DISPLAY_MODE_ALL,ZC_STATIC_DIRECTORY,i & "_" & j & "." & ZC_STATIC_TYPE)
						strArchiveYear = strArchiveYear & "<a href="""& ZC_BLOG_HOST & ZC_STATIC_DIRECTORY & "/" & i & "_" & j & "." & ZC_STATIC_TYPE & """ title="""& Replace(aryCouple_LanguageValue(7),"n%",objRS(0)) & """>" & ZVA_Month_Abbr(j) & "</a><span>("& objRS(0) &")</span> "
					Else
						strArchiveYear = strArchiveYear & "<a href="""& ZC_BLOG_HOST &"catalog.asp?date=" & i & "-" & j & """ title="""& Replace(aryCouple_LanguageValue(7),"n%",objRS(0)) & """>" & ZVA_Month_Abbr(j) & "</a><span>("& objRS(0) &")</span> "
					End If
					'If (k mod 4)=0 Then  strArchiveYear = strArchiveYear & "<br />"
					If (k mod 12)=0 Then  strArchiveYear = strArchiveYear & "<br />"
				Else

				End If
			End If

			objRS.Close
			Set objRS=Nothing
		next
		If l=True Then
			strArchives = strArchives & "<p class=""archives-year"">" & Replace(aryCouple_LanguageValue(6),"y%",i) & "</p>" & vbCrlf
			strArchives = strArchives & "<p class=""archives-month"" style=""padding: 0px 0px 0px 20px;"">" & vbCrlf
			strArchives = strArchives & strArchiveYear
			strArchives = strArchives & vbCrlf & "</p>" & vbCrlf
		End If
	Next

	strArchives=TransferHTML(strArchives,"[no-asp]")

	Call SaveToFile(BlogPath & "/include/archives.asp",strArchives,"utf-8",True)

	Couple_BlogReBuild_Archives=True

End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_BlogReBuild_Calendar()

	Dim strCalendar

	'Calendar
	strCalendar=Couple_MakeCalendar("")

	strCalendar=TransferHTML(strCalendar,"[no-asp]")

	Call SaveToFile(BlogPath & "/include/calendar.asp",strCalendar,"utf-8",True)

	Couple_BlogReBuild_Calendar=True

End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_BlogReBuild_AllCache()

	Dim strList
	Dim strListMale
	Dim strListFemale

	Dim ArticleList
	Dim AuthList
	Dim CateList
	Dim TagsList

	Dim aryAllList()
	Dim allPageCount : allPageCount=0
	Dim allListCount : allListCount=0

	Dim objRS
	Dim i
	Dim j
	Dim n
	Dim l
	Dim k

	Set objRS=Server.CreateObject("ADODB.Recordset")
	objRS.CursorType = adOpenKeyset
	objRS.LockType = adLockReadOnly
	objRS.ActiveConnection=objConn
	objRS.Source=""

	'男用户
	objRS.Open("SELECT [log_ID] FROM [blog_Article] WHERE ([log_Level]>1) AND ([log_Istop]=False) AND([log_AuthorID]="&Couple_MaleID&") ORDER BY [log_PostTime] DESC")

	If (Not objRS.bof) And (Not objRS.eof) Then

		objRS.PageSize = ZC_DISPLAY_COUNT
		If objRS.PageCount>allPageCount Then allPageCount=objRS.PageCount
		ReDim aryAllList(objRS.PageCount+1)

		For i=1 to objRS.PageCount
			objRS.AbsolutePage=i
			For j = 1 To objRS.PageSize
				If j=1 Then aryAllList(i)="AllPage" & i & "["

				If i=1 Then
					'aryAllList(i)=aryAllList(i) & objRS("log_ID") & ";"
					strListMale=strListMale & objRS("log_ID") & ";"
				End If

				If j=objRS.PageSize Then aryAllList(i)=aryAllList(i) & "]"
				objRS.MoveNext
				If objRS.EOF Then aryAllList(i)=aryAllList(i) & "]":Exit For
			Next
		Next

	End If
	objRS.Close
	strList=strList & Join(aryAllList)
	Erase aryAllList
	'分隔符
	strList=strList & "|"
	'女用户
	objRS.Open("SELECT [log_ID] FROM [blog_Article] WHERE ([log_Level]>1) AND ([log_Istop]=False) AND([log_AuthorID]="&Couple_FemaleID&") ORDER BY [log_PostTime] DESC")

	If (Not objRS.bof) And (Not objRS.eof) Then

		objRS.PageSize = ZC_DISPLAY_COUNT
		If objRS.PageCount>allPageCount Then allPageCount=objRS.PageCount
		ReDim aryAllList(objRS.PageCount+1)

		For i=1 to objRS.PageCount
			objRS.AbsolutePage=i
			For j = 1 To objRS.PageSize
				If j=1 Then aryAllList(i)="AllPage" & i & "["

				If i=1 Then
					'aryAllList(i)=aryAllList(i) & objRS("log_ID") & ";"
					strListFemale=strListFemale & objRS("log_ID") & ";"
				End If

				If j=objRS.PageSize Then aryAllList(i)=aryAllList(i) & "]"
				objRS.MoveNext
				If objRS.EOF Then aryAllList(i)=aryAllList(i) & "]":Exit For
			Next
		Next

	End If
	objRS.Close
	strList=strList & Join(aryAllList)
	Erase aryAllList

	Set objRS=Nothing

	'合并数据
	Dim strTypeM,strTypeF
	Dim aryType : aryType=Split(strList,"|")
	ReDim aryAllList(allPageCount+1)
	For i=1 to allPageCount
		strTypeM="" : strTypeF=""
		If InStr(aryType(0),"AllPage"& i &"[")>0 Then
			strTypeM=Mid(aryType(0),InStr(aryType(0),"AllPage"& i &"["),InStr(aryType(0),"]")-InStr(aryType(0),"AllPage"& i &"[")+1)
			aryType(0)=Replace(aryType(0),strTypeM,"")
			strTypeM=Replace(strTypeM,"AllPage"& i &"[","")
			strTypeM=Replace(strTypeM,"]","")
		End If
		If InStr(aryType(1),"AllPage"& i &"[")>0 Then
			strTypeF=Mid(aryType(1),InStr(aryType(1),"AllPage"& i &"["),InStr(aryType(1),"]")-InStr(aryType(1),"AllPage"& i &"[")+1)
			aryType(1)=Replace(aryType(1),strTypeF,"")
			strTypeF=Replace(strTypeF,"AllPage"& i &"[","")
			strTypeF=Replace(strTypeF,"]","")
		End If
		aryAllList(i)=aryAllList(i) & "AllPage"& i &"["& strTypeM & strTypeF &"]"
	Next
	strList=Join(aryAllList)
	Erase aryAllList

	'置顶
	strList=strList & "IstopPage1" & "[]"


	Call SaveToFile(BlogPath & "/CACHE/cache_list_"&ZC_BLOG_CLSID&".html",strList,"utf-8",False)
	Call SaveToFile(BlogPath & "/CACHE/cache_list_couple_"&ZC_BLOG_CLSID&".html",strListMale & "|" & strListFemale,"utf-8",False)

End Function
'*********************************************************



'*********************************************************
' 目的：
' 输入：
' 返回：
'*********************************************************
Function Couple_MakeCalendar(dtmYearMonth)

	Dim strCalendar

	Dim y
	Dim m
	Dim d
	Dim firw
	Dim lasw
	Dim ny
	Dim nm

	Dim i
	Dim j
	Dim k
	Dim b
	Dim s
	Dim t

	Call CheckParameter(dtmYearMonth,"dtm",Date())

	y=year(dtmYearMonth)
	m=month(dtmYearMonth)
	ny=y
	nm=m+1
	If m=12 Then ny=ny+1:nm=1

	firw=Weekday(Cdate(y&"-"&m&"-1"))

	For i=28 to 32
		If IsDate(y&"-"&m&"-"&i) Then
			lasw=Weekday(Cdate(y&"-"&m&"-"&i))
		Else
			Exit For
		End If
	Next

	d=i-1
	k=1

	If firw>5 Then b=42 Else b=35
	If (d=28) And (firw=1) Then b=28
	If (firw>5) And (d<31) And (d-firw<>23) Then b=35


'//////////////////////////////////////////////////////////
'	逻辑处理
	Dim aryDateLink(32)
	Dim aryDateID(32)
	Dim aryDateArticle(32)
	Dim objRS

	Set objRS=Server.CreateObject("ADODB.Recordset")
	objRS.CursorType = adOpenKeyset
	objRS.LockType = adLockReadOnly
	objRS.ActiveConnection=objConn
	objRS.Source=""
	objRS.Open("select [log_ID],[log_CateID],[log_AuthorID],[log_Level],[log_PostTime],[log_Url],[log_Istop] from [blog_Article] where ([log_Level]>2) And ([log_PostTime] BETWEEN #"&y&"-"&m&"-1# AND #"&ny&"-"&nm&"-1#)")

	If (Not objRS.bof) And (Not objRS.eof) Then
		For i=1 To objRS.RecordCount
			j=CInt(Day(CDate(objRS("log_PostTime"))))
			aryDateLink(j)=True
			aryDateID(j)=objRS("log_ID")
			Set aryDateArticle(j)=New TArticle
			aryDateArticle(j).LoadInfobyArray Array(objRS("log_ID"),"",objRS("log_CateID"),"","","",objRS("log_Level"),objRS("log_AuthorID"),objRS("log_PostTime"),"","","",objRS("log_Url"),"")
			objRS.MoveNext
			If objRS.eof Then Exit For
		Next
	End If
	objRS.Close
	Set objRS=Nothing
'//////////////////////////////////////////////////////////

	s=y&"-"&(m-1)
	t=y&"-"&(m+1)
	If m=1 Then s=(y-1)&"-12"
	If m=12 Then t=(y+1)&"-1"

	strCalendar=strCalendar & "<div class=""cal-panel year"&y&" month"&m&""">"
	strCalendar=strCalendar & "<div class=""cal-navbar""><p class=""y""><span style=""cursor:pointer;"" onclick=""loadCalendar('"&s&"')"">&lt;&lt;</span>  <a href="""& ZC_BLOG_HOST &"catalog.asp?date="&y&"-"&m&""">"&y&"-"&m&"</a>  <span style=""cursor:pointer;"" onclick=""loadCalendar('"&t&"')"">&gt;&gt;</span></p></div>"
	strCalendar=strCalendar & "<div class=""cal-detail""><p class=""w"">"&ZVA_Week_Abbr(1)&"</p><p class=""w"">"&ZVA_Week_Abbr(2)&"</p><p class=""w"">"&ZVA_Week_Abbr(3)&"</p><p class=""w"">"&ZVA_Week_Abbr(4)&"</p><p class=""w"">"&ZVA_Week_Abbr(5)&"</p><p class=""w"">"&ZVA_Week_Abbr(6)&"</p><p class=""w"">"&ZVA_Week_Abbr(7)&"</p>"
	j=0
	For i=1 to b
		If (j=>firw-1) and (k=<d) Then
			If aryDateLink(k) Then
				strCalendar=strCalendar & "<p id=""pCalendar_"&y&"_"&m&"_"&k&""" class=""yd""><a class=""l"" href="""& ZC_BLOG_HOST &"catalog.asp?date="&Year(aryDateArticle(k).PostTime)&"-"&Month(aryDateArticle(k).PostTime)&"-"&Day(aryDateArticle(k).PostTime)& """>"&(k)&"</a></p>"
			Else
				strCalendar=strCalendar & "<p id=""pCalendar_"&y&"_"&m&"_"&k&""" class=""d"">"&(k)&"</p>"
			End If
			k=k+1
		Else
			strCalendar=strCalendar & "<p class=""nd""></p>"
		End If
		j=j+1
	Next

	strCalendar=strCalendar & "</div></div>"
	Couple_MakeCalendar=strCalendar

End Function
'*********************************************************




'*********************************************************
' 目的：
'*********************************************************
Function Couple_IntegrityChk()

	Dim aryChkFiles : aryChkFiles=Array("script/md5.js","plugin/include.asp","plugin/RE"&"GISTER/ajax.asp","plugin/REGI"&"STER/Re"&"gister.asp","plugin/REGI"&"STER/Re"&"gister.js")
	Dim aryChkSize : aryChkSize=Array(False,8438,1390,10731,2172)

	Dim i
	For i=0 To UBound(aryChkFiles)
		If Not Couple_GetFileSize(BlogPath &"/THEMES/"& ZC_BLOG_THEME &"/"& aryChkFiles(i))=aryChkSize(i) Then Call ShowError(0)
		'Response.Write Couple_GetFileSize(BlogPath &"/THEMES/"& ZC_BLOG_THEME &"/"& aryChkFiles(i)) & ","
	Next

End Function
'*********************************************************



'*********************************************************
' 目的：    取得目标文件的大小
'*********************************************************
Function Couple_GetFileSize(strFullFileName)
On Error Resume Next
Dim objFSO,objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strFullFileName) Then
    Set objFile = objFSO.GetFile(strFullFileName)
	Couple_GetFileSize = objFile.Size
	set objFile = nothing
Else
	Couple_GetFileSize = False
End If
set objFSO = nothing
If Err Then
	Couple_GetFileSize = False
	Err.Clear
End If
End Function
'*********************************************************



'*********************************************************
' 目的：    取得目标文件的大小
'*********************************************************
Function Couple_GetFileSize(strFullFileName)
On Error Resume Next
Dim objFSO,objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strFullFileName) Then
    Set objFile = objFSO.GetFile(strFullFileName)
	Couple_GetFileSize = objFile.Size
	set objFile = nothing
Else
	Couple_GetFileSize = False
End If
set objFSO = nothing
If Err Then
	Couple_GetFileSize = False
	Err.Clear
End If
End Function
'*********************************************************



'*********************************************************
' 目的：
' 输入：
' 返回：
'*********************************************************
'加载语言包
Function Couple_BuildLanguage_List(ByRef html)
	html=Couple_BuildLanguage(html)
End Function
Function Couple_BuildLanguage_GuestBook(ByRef html,ByRef htmlWAP)
	html=Couple_BuildLanguage(html)
End Function
Function Couple_BuildLanguage_Single(ByRef Ftemplate,ByRef Template_Article_Single,ByRef Template_Article_Multi,ByRef Template_Article_Istop,ByRef Template_Article_Multi_WAP,ByRef Template_Article_Single_WAP)
	Ftemplate=Couple_BuildLanguage(Ftemplate)
	Template_Article_Single=Couple_BuildLanguage(Template_Article_Single)
	Template_Article_Multi=Couple_BuildLanguage(Template_Article_Multi)
	'Template_Article_Istop=Couple_BuildLanguage(Template_Article_Istop)
End Function
Function Couple_BuildLanguage_Single_Sub(ByRef Template_Article_Comment,ByRef Template_Article_Trackback,ByRef Template_Article_Tag,ByRef Template_Article_Commentpost,ByRef Template_Article_Navbar_L,ByRef Template_Article_Navbar_R,ByRef Template_Article_Mutuality)
	Template_Article_Comment=Couple_BuildLanguage(Template_Article_Comment)
	'Template_Article_Trackback=Couple_BuildLanguage(Template_Article_Trackback)
	'Template_Article_Tag=Couple_BuildLanguage(Template_Article_Tag)
	Template_Article_Commentpost=Couple_BuildLanguage(Template_Article_Commentpost)
	'Template_Article_Navbar_L=Couple_BuildLanguage(Template_Article_Navbar_L)
	'Template_Article_Navbar_R=Couple_BuildLanguage(Template_Article_Navbar_R)
	'Template_Article_Mutuality=Couple_BuildLanguage(Template_Article_Mutuality)
End Function
Function Couple_BuildLanguage_Comment(ByRef html)
	html=Couple_BuildLanguage(html)
End Function
Function Couple_BuildLanguage(ByVal strSource)
	Dim i,j
	For i=0 To Ubound(aryCouple_LanguageValue)
		If Not aryCouple_LanguageValue(i)=Empty Then
			j="<#COUPLE_MSG" & Right("000" & i,3) & "#>"
			strSource=Replace(strSource,j,aryCouple_LanguageValue(i))
		End If
	Next
	Couple_BuildLanguage=strSource
End Function
'*********************************************************



'*********************************************************
' 目的：
'*********************************************************
Function Couple_ClearCaches()
	On Error Resume Next

	Dim aryFileList,l
	aryFileList=LoadIncludeFiles("/THEMES/"& ZC_BLOG_THEME &"/PLUGIN/CACHE/")

	Dim fso
	Set fso = Server.CreateObject("Scripting.FileSystemObject")
		For Each l In aryFileList
			If (Not LCase(l)="index.html") Then fso.DeleteFile(BlogPath & "THEMES/"& ZC_BLOG_THEME &"/PLUGIN/CACHE/"& l)
		Next
	Set fso = Nothing

	Err.Clear
End Function
'*********************************************************


'*********************************************************
' 目的：
' 输入：
' 返回：
'*********************************************************
Function Couple_DelCache(ByRef objArticle)
	On Error Resume Next

	objArticle.Content=Couple_ArticlePostFilter(objArticle.Content)
	objArticle.Intro=Couple_ArticlePostFilter(objArticle.Intro)

	Dim intID,strDate,strFilePath
	intID=objArticle.ID
	strDate=objArticle.PostTime
	Call CheckParameter(intID,"int",0)
	Call CheckParameter(PostTime,"dtm",Empty)

	If intID=0 Then Exit Function
	If IsEmpty(strDate) Then Exit Function

	Dim fso
	Set fso = CreateObject("Scripting.FileSystemObject")
		strFilePath = BlogPath & "THEMES/"& ZC_BLOG_THEME &"/PLUGIN/CACHE/Date-" & Year(strDate) & "-" & Month(strDate) & ".html"
		If fso.FileExists( strFilePath ) Then
			fso.DeleteFile( strFilePath )
		End If

		strFilePath = BlogPath & "THEMES/"& ZC_BLOG_THEME &"/PLUGIN/CACHE/Pri_.html"
		If fso.FileExists( strFilePath ) Then
			fso.DeleteFile( strFilePath )
		End If
	Set fso = Nothing

	Err.Clear
End Function
'*********************************************************


'*********************************************************
' 目的：
' 输入：
' 返回：
'*********************************************************
Function Couple_ArticlePostFilter(ByVal strContent)

	'防止 FCK 弄出相对路径
	strContent=Replace(strContent,"../../../",ZC_BLOG_HOST)

	'给
	Dim objRegExp
	Set objRegExp = New RegExp
	objRegExp.IgnoreCase = True
	objRegExp.Global = True
	objRegExp.Pattern="(<img)([^>]+>)"

	Dim Matches,Match,SubStr
	Set Matches = objRegExp.Execute(strContent)
	For Each Match In Matches
		SubStr=Match.value
		If InStr(SubStr,ZC_BLOG_HOST & "image/face/")>0 And Not InStr(SubStr,"class=""face")>0 Then
			If InStr(SubStr,"class=""")>0 Then
				strContent=Replace(strContent,SubStr,objRegExp.Replace(SubStr,"$1") & Replace(objRegExp.Replace(SubStr,"$2"),"class=""","class=""face "))
			Else
				strContent=Replace(strContent,SubStr,objRegExp.Replace(SubStr,"$1") &" class=""face"" "& objRegExp.Replace(SubStr,"$2"))
			End If
		End If
	Next
	Set Matches = Nothing
	Set objRegExp=Nothing

	Couple_ArticlePostFilter=strContent

End Function
'*********************************************************
%>